# $Id: PKGBUILD 88089 2013-04-11 09:34:40Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Thomas Mudrunka <harvie@@email..cz>
# Maintainer: Thomas Mudrunka <harvie@@email..cz>

pkgname=mcelog
pkgver=20130411
pkgrel=1
pkgdesc="Print machine check event log from x86-64 kernel"
url="http://freshmeat.net/projects/mcelog/"
license=("GPL")
arch=('i686' 'x86_64')
makedepends=('git')
options=('docs')
backup=('etc/mcelog/mcelog.conf')
source=("git://github.com/andikleen/mcelog.git"
	"${pkgname}.rc"
	"mcelog.service")
md5sums=('SKIP'
         'f039a77d7bde3518d3d695b144816e8a'
         'b71eb82e532aed3918ebf6b30e158e7f')

build() {
  cd "${srcdir}/mcelog"
  make
}

package() {
  cd "${srcdir}/mcelog"
  mkdir -p $pkgdir/usr/share/doc/mcelog
  make install prefix=$pkgdir/usr etcprefix=$pkgdir DOCDIR=$pkgdir/usr/share/doc/mcelog
  install -Dm0755 mcelog.cron "${pkgdir}/usr/sbin/mcelog.cron"
  install -Dm0755 "${srcdir}/mcelog.rc" "${pkgdir}/etc/rc.d/mcelog"
  install -Dm0644 mcelog.logrotate "${pkgdir}/etc/logrotate.d/mcelog.logrotate"
  install -Dm0644 README "${pkgdir}/usr/share/doc/mcelog/README"
  install -Dm0644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
}
